package ch.fhnw.qualiscan;

import ch.fhnw.qualiscan.core.libraries.LanguageLib;
import ch.fhnw.qualiscan.core.libraries.UrlLib;

import com.vaadin.ui.Window;

import eu.livotov.tpt.TPTApplication;

/**
 * Entry point of vaadin application. Creates the AppLoader instance.
 * @author Kevin Mettenberger, Benjamin Groehbiel
 *
 */

@SuppressWarnings("serial")
public class QuickscanApplication extends TPTApplication {
	
	Window mainWindow = new Window(Config.SITE_TITLE);
	
	private UrlLib urlLib;
	private LanguageLib languageLib;
	
	@Override
	public void applicationInit() {
		AppObject appObject = new AppObject();
		
		urlLib = new UrlLib();
		appObject.setUrlLib(urlLib);
		
		languageLib = new LanguageLib();
		
		languageLib.setLanguage("en");
		appObject.setLanguageLib(languageLib);
		
		mainWindow.setSizeFull();
		
		//attach the data object to the main window.
    	mainWindow.setData(appObject);

		setMainWindow(mainWindow);
		setTheme("qualiscan");
		
		urlLib.initUrl();
		
		AppLoader quickscan = new AppLoader();
		quickscan.load();
		quickscan.init();
	}

	@Override
	public void firstApplicationStartup() {}
	
}
